import { Controller, Inject, Get } from '@nestjs/common';
import { UserService } from './user.service';
import { ConfigService } from '@nestjs/config';

@Controller('user')
export class UserController {
  @Inject(ConfigService)
  private configService: ConfigService;
  constructor(private readonly userService: UserService) {}
  @Get()
  getHello(): any {
    const config = {
      url: this.configService.get('db.mysql.url'),
      port: this.configService.get('db.mysql.port'),
      database: this.configService.get('db.mysql.database'),
      password: this.configService.get('db.mysql.password'),
    };
    console.log(config);
    return config;
  }
}
